package com.zackratos.ultimatebarx.sample

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.zackratos.ultimatebarx.sample.adjustresize.AdjustResizeActivity
import com.zackratos.ultimatebarx.sample.bottomnav.BottomNavActivity
import com.zackratos.ultimatebarx.sample.case.CaseImmersionAct
import com.zackratos.ultimatebarx.sample.databinding.ActivityMainBinding
import com.zackratos.ultimatebarx.sample.xpopup.demo.MainActivity
import com.zackratos.ultimatebarx.ultimatebarx.navigationBar
import com.zackratos.ultimatebarx.ultimatebarx.statusBar

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        var bind = ActivityMainBinding.inflate(layoutInflater)
        setContentView(bind.root)
//        setContentView(R.layout.activity_main)
        setSupportActionBar(bind.toolbar)
        statusBar {
            fitWindow = true
            colorRes = R.color.deepSkyBlue
        }
        navigationBar {
            fitWindow = true
            colorRes = R.color.deepSkyBlue
        }

        bind.btnToCaseImmersion.setOnClickListener { start(CaseImmersionAct::class.java) }

        bind.btnTransparent.setOnClickListener { start(TransparentActivity::class.java) }
        bind.btnSwitch.setOnClickListener { start(SwitchActivity::class.java) }
        bind.btnSwitch2.setOnClickListener { start(SwitchFragmentActivity::class.java) }
        bind.btnViewPager.setOnClickListener { start(ViewPagerActivity::class.java) }
        bind.btnViewPager2.setOnClickListener { start(ViewPagerActivity2::class.java) }
        bind.btnScroll.setOnClickListener { start(ScrollActivity::class.java) }
        bind.btnDrawer.setOnClickListener { start(DrawerActivity::class.java) }
        bind.btnRecyclerFragment.setOnClickListener { start(RecyclerFragmentActivity::class.java) }
        bind.btnFragmentStack.setOnClickListener { start(FragmentStackActivity::class.java) }
        bind.btnPadding.setOnClickListener { start(AddPaddingActivity::class.java) }
        bind.btnCoordinator.setOnClickListener { start(CoordinatorActivity::class.java) }
        bind.btnBottonNav.setOnClickListener { start(BottomNavActivity::class.java) }
        bind.btnAdjustResize.setOnClickListener { start(AdjustResizeActivity::class.java) }
        bind.btnToXPopup.setOnClickListener { start(MainActivity::class.java) }
    }

    private fun start(clazz: Class<out Activity>) {
        startActivity(Intent(this, clazz))
    }
}
